package com.magic.gre.mvp.model;

import com.magic.gre.Api;
import com.magic.gre.mvp.contract.ModefyPwsdContract;
import com.noname.lib_base_java.mvp.BaseModelImpl;
import com.noname.lib_base_java.net.RtManager;
import com.noname.lib_base_java.util.EncryptUtils;

import io.reactivex.Observable;
import io.reactivex.Observer;
import okhttp3.ResponseBody;

/**
 * Author: Lmoumou
 * Date: 2019-01-10 17:00
 * 文件名: ModefyPwsdModelImpl
 * 描述:
 */
public class ModefyPwsdModelImpl extends BaseModelImpl implements ModefyPwsdContract.Model {
    @Override
    public void mModify(Observer<ResponseBody> observer,String phone, String newPwd) {

        Observable<ResponseBody> observable = RtManager.getInatance().createApi(Api.class).resetPwd(phone,EncryptUtils.encodeByMd5(newPwd));
        doHttp(observer, observable);
    }
}
